package servlet;

import java.io.IOException;
import java.io.PrintWriter;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.db.conn;

public class members_Delete extends HttpServlet {


	public members_Delete() {
		super();
	}


	public void destroy() {
		super.destroy(); 
	}

	//删除客户信息
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html;");
		PrintWriter out = response.getWriter();

         //声明数据库操作类
		conn cn = new conn();

        //得到要删除的ID
        String id = request.getParameter("id");

        //设置删除sql
        String sql="delete from members where mid = "+id;
       
		
	
        //执行sql
		int i=cn.update(sql);
		
		out.println("<script>");
		out.println("alert('操作成功');");
		out.println("window.location='"+request.getHeader("Referer")+"'");
		out.println("</script>");

		out.flush();
		out.close();
	}


	public void init() throws ServletException {
		// Put your code here
	}

}

